package es.supermanager;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Principal {


	public static void main(String[] args) {

		try {
			ServerSocket servSocket;
			Socket fromClientSocket;
			int cTosPortNumber = 1777;

			servSocket = new ServerSocket(cTosPortNumber);

			while (true) {
				System.out.println("Waiting for a connection on "
						+ cTosPortNumber);
				fromClientSocket = servSocket.accept();
				
				Servidor server = new Servidor(fromClientSocket);
				Thread serverThread = new Thread(server);

				serverThread.start();

			}
			
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}

}